import os
import copy
import awtk_config as awtk

BIN_DIR=os.environ['BIN_DIR'];
LIB_DIR=os.environ['LIB_DIR'];

sources = Glob('buffered/*.c') + Glob('file/*.c') \
  +  Glob('inet/*.c') +  Glob('mem/*.c') +  Glob('serial/*.c') \
  +  Glob('shdlc/*.c') + Glob('noisy/*.c') + Glob('misc/*.c') 

env=DefaultEnvironment().Clone()

env.Library(os.path.join(LIB_DIR, 'streams'), sources, LIBS=['tkc'])

LIBS=awtk.STATIC_LIBS

env.Program(os.path.join(BIN_DIR, 'udp_send'), ['tools/udp_send.c'], LIBS=LIBS);
env.Program(os.path.join(BIN_DIR, 'udp_recv'), ['tools/udp_recv.c'], LIBS=LIBS);
env.Program(os.path.join(BIN_DIR, 'serial_echo'), ['tools/serial_echo.c'], LIBS=LIBS);
env.Program(os.path.join(BIN_DIR, 'serial_send'), ['tools/serial_send.c'], LIBS=LIBS);
env.Program(os.path.join(BIN_DIR, 'serial_at'), ['tools/serial_at.c'], LIBS=LIBS);
env.Program(os.path.join(BIN_DIR, 'shdlc_send'), ['tools/shdlc_send.c'], LIBS=LIBS);
env.Program(os.path.join(BIN_DIR, 'shdlc_recv'), ['tools/shdlc_recv.c'], LIBS=LIBS);
